//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using CommunityServer.Configuration;

namespace CommunityServer.Discussions.Components
{
	[System.Xml.Serialization.XmlRoot("AttachmentSettings")]
	public class ForumAttachmentSettings : AttachmentSettings
	{
		public ForumAttachmentSettings()
		{
		}

		#region Public Properties

		[System.Xml.Serialization.XmlIgnore()]
		public int MaxAttachmentSize
		{
			get 
			{
				return ForumConfiguration.Instance().MaxAttachmentSize;
			}
		}

		[System.Xml.Serialization.XmlIgnore()]
		public override string Extensions
		{
			get
			{
				return ForumConfiguration.Instance().AllowedAttachmentTypes;
			}
		}

		#endregion

		public override string ValidationPattern
		{
			get
			{
				return  ValidateExtensions ? string.Format(basePattern,Extensions.Replace(';','|')) : ".+";
			}
		}

		public override void DeleteAttachmentFromDisk(int postID)
		{
			throw new NotImplementedException();
		}

	}
}
